<?php
session_start();
require_once("include/authen.php");
require_once("include/ui.php");
if ($_SESSION["permission"][$userScreen]["View"]=="0"){
	echo "<script>alert('".$no_permit."');</script>";
	echo "<meta http-equiv = refresh ; content = '0 ; url = mainscreen.php'>";
	exit();
}
// show header
echo headerPage("User Maintenance");
?>
<SCRIPT src="js/js_user.js"></SCRIPT>
<script>
$(function() {
 
		$( "#txtDateTo" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
		$("#btnPrint").live('click',function(){
		$("#normal-screen").hide();
		$("#page-header").hide();
		$("#searchdata").hide();
		$(".toolbar-box").hide();
		$("#foolter_table").hide();
		$("#leftboder").hide();
		$("#rightboder").hide();
		window.print();
		
		$("#normal-screen").show();
		$("#page-header").show();
		$("#searchdata").show();
		$(".toolbar-box").show();
		$("#foolter_table").show();
		$("#leftboder").show();
		$("#rightboder").show();
	});	
 
	$( "#tabs" ).tabs();
 
});
</script>
<FORM name="Act" action="<?php echo $PHP_SELF?>" method="post">
	<INPUT type=hidden value="add" id="mode" name="mode"> <INPUT
		type=hidden value="Admin" id="user" name="user">

	<table width="1024" border="0" align="center" cellpadding="0"
		cellspacing="0">
		<tr>

			<td width="10" id='leftboder' style="border-left: 2px solid #facb0c;">&nbsp;</td>
			<td width="1004" valign="top">
				<div class="content-box">
					<div Class="toolbar-box">
						<div class="t">
							<div class="t">
								<div class="t"></div>
							</div>
						</div>
						<div class="m">
							<div class="toolbar">
								<table class="toolbar">
									<tr>
										<td><?php  if ($_SESSION["permission"][$userScreen]["Add"]=="1") {?>
											<a href="javascript:void('0');" id="btnAdd"> <span
												class="icon_add"></span>Add </a> <?php }?>
										</td>
										<td><a href="javascript:void('0');" title="Print"
											id="btnPrint"> <span class="icon_Print"></span>Print </a>
										</td>
									</tr>
								</table>
							</div>
							<div class="header"
								style="background-image: url(images/user.png);">User Maintenance
							</div>
							<div class="clr"></div>
						</div>
						<div class="b">
							<div class="b">
								<div class="b"></div>
							</div>
						</div>
					</div>
					<div id="element-box">
						<div class="t">
							<div class="t">
								<div class="t"></div>
							</div>
						</div>
						<div class="m">
							<table width="100%" id='searchdata'>
								<tr>
									<td width="10%" class="fontSearch" style="padding-left: 20">Fist-Last
										Name :</td>
									<td width="85%" align=left><input id="txtUserName_s"
										title="Filter by user name " type="text" size=40 name="code"
										class="boxItem" />
									</td>
								</tr>
								<tr>
									<td class="fontSearch" style="padding-left: 20">Position :</td>
									<td width="85%" align=left><select name="cboPosition"
										style="width: 10em;" id="cboPosition">
									</select>
									</td>
								</tr>
								<tr>
									<td class="fontSearch" style="padding-left: 20">Group :</td>
									<td align=left><select name="cboGroup" style="width: 10em;"
										id="cboGroup">
									</select>
									</td>
								</tr>
								<tr>
									<td class="fontSearch" style="padding-left: 20">Branch :</td>
									<td align=left><select name="cboBranch" style="width: 20em;"
										id="cboBranch">
									</select>
									</td>
								</tr>
								<tr>
									<td class="fontSearch" style="padding-left: 20">SMS :</td>
									<td align=left><input type='checkbox' name="IsSMS" id='IsSMS'
										value="1" />Received SMS</td>
								</tr>
								<tr>
									<td />
									<td><a href="javascript:void('0');" id="btnSearch"><img
											src="./images/btn-search.gif" border=0 /> </a>
									</td>
								</tr>
								<tr>
									<td colspan="2">
								
								</tr>
							</table>
							<table cellspacing="1" id="resultData" class=list>
								<thead>
									<tr>
										<th width="3%">No.</th>
										<th style='display: none'>ID</th>
										<th class="title" width="15%">User Name</th>
										<th class="title" width="30%" nowrap="nowrap">First-Last Name</th>
										<th class="title" width="10%" nowrap="nowrap">Position</th>
										<th class="title" width="10%" nowrap="nowrap">Branch</th>
										<th class="title" width="10%" nowrap="nowrap">Group</th>
										<th class="title" width="10%" nowrap="nowrap">Status</th>
										<th class="title" width="5%" nowrap="nowrap">Edit</th>
										<th class="title" width="5%" nowrap="nowrap">Del</th>
									</tr>
								</thead>
								<tbody>

								</tbody>
								<tfoot>
									<tr>
										<td colspan="9">
											<div class="boxfooter">
												<div id="paging_btn"></div>
												<div class="totalpage">
													Total : <span id="rowCount"></span>&nbsp;&nbsp;rows
												</div>
											</div>
										</td>
									</tr>
								</tfoot>
							</table>
							<div class="clr"></div>
						</div>
						<div class="b">
							<div class="b">
								<div class="b"></div>
							</div>
						</div>
						<div class="clr"></div>
					</div>
					<!-- elementbox-->
				</div>
			</td>
			<td width="10" id='leftboder'
				style="border-right: 2px solid #facb0c;">&nbsp;</td>

		</tr>
	</table>
</FORM>

<div id="dialog-confirm" title="Confirm delete?"
	style="padding-top: 20px;">
	<p style="font-size: 13px">
		<span class="ui-icon ui-icon-alert"
			style="float: left; margin: 0 7px 20px 0;"> </span>Are you sure this
		User?
	</p>
</div>
<div id="dialog-form">
	<p class="validateTips">* fields are required.</p>
	<form>
		<div id="tabs">
			<ul>
				<li><a href="#tabs-1">Customer Info</a></li>
				<li><a href="#tabs-2">Commission</a></li>
				<li><a href="#tabs-3">Picture</a></li>
			</ul>
			<div id="tabs-1">
				<table cellpadding="0" cellspacing="3" border="0" width="100%"
					class="fieldset">
					<tr>
						<td width="30%"><label for="name">User Name *</label></td>
						<td width="70%"><input type="text" name="UserName" id="UserName"
							class="text ui-widget-content ui-corner-all" /></td>
					</tr>
					<tr>
						<td width="30%"><label for="name">Password *</label></td>
						<td width="70%"><input type="password" name="Password"
							id="Password" class="text ui-widget-content ui-corner-all" /></td>
					</tr>
					<tr>
						<td width="30%"><label for="name">ID Card </label></td>
						<td width="70%"><input type="text" name="IDCard" id="IDCard"
							class="text ui-widget-content ui-corner-all" /></td>
					</tr>
					<tr>
						<td width="30%"><label for="name">Frist Name *</label></td>
						<td width="70%"><input type="text" name="FirstName" id="FirstName"
							class="text ui-widget-content ui-corner-all" /></td>
					</tr>
					<tr>
						<td width="30%"><label for="name">Last Name </label></td>
						<td width="70%"><input type="text" name="LastName" id="LastName"
							class="text ui-widget-content ui-corner-all" /></td>
					</tr>
					<tr>
						<td width="30%"><label for="name">Nick Name </label></td>
						<td width="70%"><input type="text" name="NickName" id="NickName"
							class="text ui-widget-content ui-corner-all" /></td>
					</tr>
					<tr>
						<td><label for="name">Address *</label></td>
						<td><textarea id="Address" rows="3" cols="35"
								class="text ui-widget-content ui-corner-all"></textarea></td>
					</tr>
					<tr>
						<td width="30%"><label for="name">Email * </label></td>
						<td width="70%"><input type="text" name="Email" id="Email"
							class="text ui-widget-content ui-corner-all" /></td>
					</tr>
					<tr>
						<td width="30%"><label for="name">Telephone * </label></td>
						<td width="70%"><input type="text" name="Telephone" id="Telephone"
							class="text ui-widget-content ui-corner-all" /></td>
					</tr>
					<tr>
						<td width="30%"><label for="name">Position</label></td>
						<td width="70%"><select name="PositionID"
							style="width: 15em; height: 30px; font-size: 12px; padding: 5px;"
							id="PositionID"
							class="ui-widget ui-widget-content ui-corner-left" /></td>
					</tr>
					<tr>
						<td width="30%"><label for="name">Group</label></td>
						<td width="70%"><select
							style="width: 15em; height: 30px; font-size: 12px; padding: 5px;"
							name="GroupID" id="GroupID"
							class="ui-widget ui-widget-content ui-corner-left" /></td>
					</tr>
					<!-- tr>
						<td width="30%"><label for="name">Branch</label></td>
						<td width="70%"><select
							style="width: 20em; height: 30px; font-size: 12px; padding: 5px;"
							class="ui-widget ui-widget-content ui-corner-left"
							name="BranchID" id="BranchID" /></td>
					</tr> -->

					<tr>
						<td><label for="status">Status </label></td>
						<td><input type="checkbox" name="IsActived" id="IsActived"
							value="" checked /><label for="status" for="status"
							style='font-weight: normal'>Actived</label></td>
					</tr>
					<!-- tr class="tr_sms">
						<td><label for="status">SMS </label></td>
						<td><input type="checkbox" name="SMS" id="SMS" value="" checked /><label
							for="status" style='font-weight: normal'>Received SMS from Branch</label>
						</td>
					</tr -->
				</table>
			</div>
			<div id="tabs-2">
				<table cellpadding="0" cellspacing="3" border="0" width="100%"
					class="fieldset">
					<tr>
						<td><label for="name">สิทธิ์ส่วนลด:</label>
						</td>
						<td width="40%"><input type="text" value="0" name="Discount"
							style="width: 90%; padding: 5px; font-size: 12px;text-align: right;" maxlength=3
							id="Discount" class="ui-widget-content ui-corner-all" />
						<td width="30%" align="left"><select name="DiscountType" id="DiscountType"
							class="ui-widget ui-widget-content ui-corner-left"
							style="width: 6em; font-size: 12px;">
								<option value="0">BAHT</option>
								<option value="1">%</option>
						</select></td>


					</tr>
					<tr>
						<td><input type="checkbox" /><label for="name">สินค้า </label></td>
						<td width="40%"><input type="text" value="0" name="ProductComs"
							style="width: 90%; padding: 5px; font-size: 12px; text-align: right;"
							maxlength=3 id="ProductComs"
							class="ui-widget-content ui-corner-all" /></td>
						<td width="30%" align="left"><select name="ProductComsType"
							id="ProductComsType"
							class="ui-widget ui-widget-content ui-corner-left"
							style="width: 6em; font-size: 12px;">
								<option value="0">BAHT</option>
								<option value="1">%</option>
						</select>
						</td>
					</tr>

					<tr>
						<td colspan="3" height="20px"><label for="name">บริการ </label></td>
					</tr>

					<tr>
						<td style="padding-left: 20px;"><input type="checkbox" /><label
							for="name">แนะนำ </label></td>
						<td width="40%"><input type="text" value="0" name="SuggessComs"
							style="width: 90%; padding: 5px; font-size: 12px; text-align: right;"
							maxlength=3 id="SuggessComs"
							class="ui-widget-content ui-corner-all" /></td>
						<td width="30%" align="left"><select name="SuggessComsType"
							id="SuggessComsType"
							class="ui-widget ui-widget-content ui-corner-left"
							style="width: 6em; font-size: 12px;">
								<option value="0">BAHT</option>
								<option value="1">%</option>
						</select>
						</td>
					</tr>
					<tr>
						<td style="padding-left: 20px;"><input type="checkbox" /><label
							for="name">ให้บริการ </label></td>
						<td width="40%"><input type="text" value="0" name="ServiceComs"
							style="width: 90%; padding: 5px; font-size: 12px; text-align: right;"
							maxlength=3 id="ServiceComs"
							class="ui-widget-content ui-corner-all" /></td>
						<td width="30%" align="left"><select name="ServiceComsType"
							id="ServiceComsType"
							class="ui-widget ui-widget-content ui-corner-left"
							style="width: 6em; font-size: 12px;">
								<option value="0">BAHT</option>
								<option value="1">%</option>
						</select>
						</td>
					</tr>

					<tr>
						<td><input type="checkbox" /><label for="name">นัดหมาย</label></td>
						<td width="40%"><input type="text" value="0" name="AppointComs"
							style="width: 90%; padding: 5px; font-size: 12px; text-align: right;"
							maxlength=3 id="AppointComs"
							class="ui-widget-content ui-corner-all" /></td>
						<td width="30%" align="left"><select name="AppointComsType"
							id="AppointComsType"
							class="ui-widget ui-widget-content ui-corner-left"
							style="width: 6em; font-size: 12px;">
								<option value="0">BAHT</option>
								<option value="1">%</option>
						</select>
						</td>
					</tr>
				</table>
			</div>
			<div id="tabs-3">
			
			</div>
		</div>
	</form>
</div>
<?php echo footer();?>